<template>
  <NstdDropdown @command="handleCommand">
    <span class="el-dropdown-link">
      Dropdown List<el-icon class="el-icon--right"><arrow-down /></el-icon>
    </span>
    <template #dropdown>
      <NstdDropdownMenu>
        <NstdDropdownItem command="a">Action 1</NstdDropdownItem>
        <NstdDropdownItem command="b">Action 2</NstdDropdownItem>
        <NstdDropdownItem command="c">Action 3</NstdDropdownItem>
        <NstdDropdownItem command="d" disabled>Action 4</NstdDropdownItem>
        <NstdDropdownItem command="e" divided>Action 5</NstdDropdownItem>
      </NstdDropdownMenu>
    </template>
  </NstdDropdown>
</template>

<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { ArrowDown } from '@element-plus/icons-vue'

const handleCommand = (command: string | number | object) => {
  ElMessage(`click on item ${command}`)
}
</script>
<style scoped>
.example-showcase .el-dropdown-link {
  cursor: pointer;
  color: var(--el-color-primary);
  display: flex;
  align-items: center;
}
</style>
